package com.cskaoyan.weixin.controller;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.weixin.bean.user.UserIndexVO;
import com.cskaoyan.weixin.bean.user.UserOrderVO;
import com.cskaoyan.weixin.service.UserWxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("wx/user")
public class UserWxController {

    @Autowired
    UserWxService userWxService;

    @RequestMapping("index")
    public BaseRespVo userIndex(){
        UserOrderVO userOrderVO = userWxService.queryOrderOfUser();
        UserIndexVO userIndexVO = new UserIndexVO(userOrderVO);
        return BaseRespVo.ok(userIndexVO);
    }
}
